package com.atelier.plugin.ptestProject;

import com.intellij.icons.AllIcons;
import com.intellij.ide.starters.local.*;
import com.intellij.ide.starters.shared.*;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.Arrays;
import java.util.List;

public class TestProjectBuilder extends StarterModuleBuilder {
    private static final StarterLanguage JAVA_STARTER_LANGUAGE = new StarterLanguage("java", "Java", "JAVA", true,"Java");
    private static final StarterLanguage KOTLIN_STARTER_LANGUAGE = new StarterLanguage("kotlin", "Kotlin", "kotlin",true,"Kotlin");
    private static final StarterProjectType MAVEN_PROJECT = new StarterProjectType("maven", "Maven", "Maven");
    private static final StarterProjectType GRADLE_PROJECT =new  StarterProjectType("gradle", "Gradle","Gradle") ;

    @Override
    public @NotNull List<StarterLanguage> getLanguages() {
        return Arrays.asList(JAVA_STARTER_LANGUAGE, KOTLIN_STARTER_LANGUAGE);
    }

    @Override
    public @NotNull List<StarterProjectType> getProjectTypes() {
        return Arrays.asList(MAVEN_PROJECT, GRADLE_PROJECT);
    }

    @Override
    public @NotNull StarterPack getStarterPack() {
        return new StarterPack("test-project", Arrays.asList(
                new Starter("test", "Test Project", null, null)
        ));
    }

    @Override
    public @NotNull Icon getNodeIcon() {
        return AllIcons.Nodes.Module;
    }

    @Override
    public @NotNull String getPresentableName() {
        return "Test Project";
    }

    @Override
    public @NotNull String getDescription() {
        return "This is a test project.";
    }

    @Override
    public @NotNull String getBuilderId() {
        return "TestProjectBuilder";
    }

    /**
     * @param starter
     * @return
     */
    @NotNull
    @Override
    protected List<GeneratorAsset> getAssets(@NotNull Starter starter) {
        return null;
    }

    /**
     * @return
     */
    @NotNull
    @Override
    protected List<StarterTestRunner> getTestFrameworks() {
        return List.of(new StarterTestRunner("junit", "JUnit"));
    }
}
